<template>
<!-- （账单详情） -->
<div class="w750" :class="pdCashLogDetailData?'':'white-bg'">
		<!-- 账单详情 -->
		<div class="bill" v-if="pdCashLogDetailData">
			<div class="item">
				<div class="num">
					<span class="symbol">{{pdCashLogDetailData.amount>0 ? '+' : ''}}
						<em class="now">{{Money(pdCashLogDetailData.amount)[0]}}</em>.{{Money(pdCashLogDetailData.amount)[1]}}
					</span>
				</div>
				<div class="state">{{pdCashLogDetailData.id ? '交易成功' : '交易失败'}}</div>
			</div>
			<div class="item mt10" v-if="pdCashLogDetailData">
				<div class="line">
					<div class="left">账单类型：</div>
					<div class="right">{{logTypeText}}</div>
				</div>
				<div class="line">
					<div class="left">账单详情：</div>
					<div class="right">{{pdCashLogDetailData.logDesc}}</div>
				</div>
			</div>
			<div class="item mt10" v-if="pdCashLogDetailData">
				<div class="line" v-if="pdCashLogDetailData.addTime">
					<div class="left">交易时间：</div>
					<div class="right">{{pdCashLogDetailData.addTime | dateformat('YYYY-MM-DD HH:mm:ss')}}</div>
				</div>
				<div class="line">
					<div class="left">账单编号：</div>
					<div class="right">{{pdCashLogDetailData.sn}}</div>
				</div>
			</div>
		</div>
		<Noempty :pic="require('../../assets/images/record-empty.png')" :title="'没有符合条件的数据'"  v-if="!pdCashLogDetailData"/>
		<!-- /账单详情 -->
	</div>
</template>

<script>
import Noempty from 'components/Noempty/Noempty';
import cash from 'utils/tool';//引入处理分割金额的方法(变量)
import {pdCashLogDetail,} from 'api/preDeposit';
export default {
	components:{
		Noempty
	},
	data () {
		return {
			Money: cash,
			id:this.$route.query.id,
			pdCashLogDetailData:'',
			logTypeText:''//存放账单类型
		}
	},
	mounted () {
    let that = this

		pdCashLogDetail({id:this.id}).then(res =>{
			if(res.status==1){
				this.pdCashLogDetailData=res.result
				switch(this.pdCashLogDetailData.logType){
					case 'order_freeze':this.logTypeText='下单支付被冻结';break;
					case 'auctions_freeze':this.logTypeText='冻结';break;
					case 'order_finally':this.logTypeText='下单';break;
					case 'recharge':this.logTypeText='充值';break;
					case 'withdraw':this.logTypeText='提现';break;
					case 'commission':this.logTypeText='佣金收入';break;
					case 'promoter':this.logTypeText='退还保证金';break;
					case 'refund':this.logTypeText='退款';break;
					case 'auctions_deduct':this.logTypeText='扣除保证金';break;
					default:this.logType='获取数据失败'}
			}else{
			this.$toast({duration: 1000,message:res.msg})}
		}),()=>{this.$toast('网络请求异常')}
	}
}
</script>

<style src="../../assets/css/pre-deposit.css" scoped></style>